package com.webBasic.service;

import com.alibaba.druid.util.StringUtils;
import com.webBasic.domain.User;
import com.webBasic.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * @author:zga
 * @date:2015/11/4
 */
@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public HashMap selectUserByUserNameAndPassword(User paramUser){
        HashMap hashMap = userMapper.selectUserByUserNameAndPassword(paramUser);
        return hashMap;
    }

    public boolean selectUserByUserName(String userName){
        String name = userMapper.selectUserByUserName(userName);
        if(StringUtils.isEmpty(name)){
            return false;
        }
        return true;
    }
}
